﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsForms1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            //消息框
            MessageBox.Show("Hello,Everyone!");
            //默认确定(OK)
            //内容，标题，按钮，图标
            var result = MessageBox.Show("内容", "标题", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
            //dialoresult:点击不同按钮，得到不同返回值
            if (result == DialogResult.Yes)
            {
                MessageBox.Show("上当了");
            }
            else
            {
                MessageBox.Show("又被骗了");
            }
        }

        //鼠标单击事件的方法
        private void Form1_MouseClick(object sender, MouseEventArgs e)
        {
            var WForm = new WForm();
            WForm.Show();
        }
    }
}
